Ext.define('DragonApp.view.main.ChangePass', {
    extend: 'Ext.form.Panel',
    xtype: 'changepass',

    layout: {
        type: 'anchor'
    },
    defaults: {
        xtype: 'textfield',
        anchor: '100%',
        labelWidth: 70,
        vtype: 'alphanum',
        allowBlank: false,
        enableKeyEvents: true,
        afterLabelTextTpl: DragonApp.util.String.required,
        listeners: {
            specialKey: 'onTextFieldSpecialKey'
        }
    },
    items: [{
        name: 'oldpass',
        fieldLabel: '旧密码',
        maxLength: 15,
        emptyText: '旧密码'
    }, {
        name: 'newpass',
        fieldLabel: '新密码',
        maxLength: 15,
        emptyText: '新密码'
    }, {
        name: 'user',
        fieldLabel: '用户名',
        xtype: 'hiddenfield',
        maxLength: 15,
        emptyText: 'user'

    }],

    buttons: [ {
        text: '取消',
        iconCls: 'fa fa-times fa-lg',
        formBind: false,
        handler: function(button) {
            var changPass = button.up('window');
            changPass.destroy();
        }
    },{
        text: '确认',
        id: 'loginBtn',
        iconCls: 'fa fa-sign-in fa-lg',
        formBind: true,
        listeners: {
            click: 'onConfirmChangeClick'
        }
    }]
});